﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Skyworth.CRM.Service.Entity;
using Skyworth.CRM.Service.IBLL;
using Skyworth.CRM.Service.IDAL;

namespace Skyworth.CRM.BLL
{
   public  class DepartmentBLL:IDepartmentBLL
    {
       private IDepartmentDAL _departmentDAL;

       public DepartmentBLL(IDepartmentDAL departmentDAL)
        {
            _departmentDAL = departmentDAL;
        }

       public DataTable Query(string strWhere)
       {
           return _departmentDAL.Query(strWhere);
       }

       public DataTable GetAllDepartment()
       {
           return _departmentDAL.GetAllDepartment();
       }

       public DataTable GetAllSubDepartment(int parentId)
       {
           return _departmentDAL.GetAllSubDepartment(parentId);
       }

       public DataTable GetSubDepartment(int parentId)
       {
           return _departmentDAL.GetSubDepartment(parentId);
       }

       public void Add(Department department)
       {
            _departmentDAL.Add(department);
       }

       public bool Update(Department department)
       {
           return _departmentDAL.Update(department);
       }

       public bool Delete(int departmentId)
       {
           return _departmentDAL.Delete(departmentId);
       }
    }
}
